echo off
chcp 65001
if "%1"=="--help" goto Syntax

echo Running scripts ...

if "%2"=="" (
	if "%1"=="" goto Syntax
	
	set R="root"
	set M=%1
) else (
	set R=%1
	set M=%2
)

::Main

echo Executing NT_Create.sql script
mysql -u%R% -p%M%< "NT_Create.sql"

echo Executing NT_Insert.sql script
mysql -u%R% -p%M%< "NT_Insert.sql"

echo Executing NT_Procedure.sql script
mysql -u%R% -p%M%< "NT_Procedure.sql"

echo Executing tb_tin_tuc.sql script
mysql -u%R% -p%M%< "tb_tin_tuc.sql"

goto End

:Syntax
echo RunSQL.bat, version 1.00 for Windows NT 4  and later
echo Excute import database nhatrodb for website phongtrovn
echo ---------------------
echo Usage: RunSQL [user] [password]
echo ---------------------
echo If user is empty, user default is "root"
echo Written by ...
echo http://phongtrovn.com

:End
echo Completed
pause
